<style type="text/css">
    .a{
        display: block;
        width:16px;height: 14px;
        background-image: url(__PUBLIC__/images/xin02.png);
        float: left;
    }
    .b{
        display: block;
        width:16px;height: 14px;
        background-image: url(__PUBLIC__/images/xin01.png);
        float: left;
    }
</style>
<form method="post" onsubmit="return postdata(this);">
    <div class="con">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>城市：<input type="text" class="TextH20" style="width:150px;" value="{$info.area}" name="areaval" id="areaval" placeholder="请输入拼音或者名称选择"/></td>
                <td>医院：<input type="text" id="hospital" name="hospital" value="" placeholder="请输入医院名称"></td>
            </tr>
            <tr>
                <td>科室：<input type="text" id="keshi_id" name="keshi" value="" placeholder="请输入医院科室"></td>
                <td>医生：<input type="text" id="doctor_id" name="doctor" value="" placeholder="请输入医院医生"></td>
            </tr>
            <tr>
                <td id="_fenshu"><div style=" float: left;">评分：</div><a class="b" id="1"></a><a class="a" id="2"></a><a class="a" id="3"></a><a class="a" id="4"></a><a class="a" id="5"></a></td>
                <td>&nbsp;<input type="hidden" name="fenshu" id="fenshu" value="1"/>
                    <input type="hidden" name="categoryid" id="categoryid" value="{$categoryid}"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">评价：</td>
            </tr>
            <tr>
                <td colspan="2"><textarea name="con" id="con_id" style="width:500px; height: 120px;"></textarea> </td> 
            </tr>
        </table>
    </div>
    <center><input type="submit" class="sub-btn" value="提交"  /></center>
</form>
<script type="text/javascript" src="__PUBLIC__/js/ymPrompt/ymPrompt.js"></script>
<link rel="stylesheet" id='skin' type="text/css" href="__PUBLIC__/js/ymPrompt/skin/qq/ymPrompt.css" />
<link href="__PUBLIC__/themes/default/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-ui-ext.js"></script>
<script type="text/javascript">
    $(function() {
        JqueryUi.autoComplete({id: "areaval", url: function() {
                return '/index.php?s=/Common/getArea';
            }});
        JqueryUi.autoComplete({id: "hospital", url: function() {
                var area = $('#areaval').val();
                return '/index.php?s=/Common/gethospital&area=' + encodeURIComponent(area);
            }});
        JqueryUi.autoComplete({id: "keshi_id", url: function() {
                var hospital = $('#hospital').val();
                return '/index.php?s=/Common/getKeshi/id/' + encodeURIComponent(hospital);
            }});
        JqueryUi.autoComplete({id: "doctor_id", url: function() {
                var hospital = $('#hospital').val();
                return '/index.php?s=/Common/getDoctor/id/' + encodeURIComponent(hospital);
            }});
        $('#_fenshu').find('a').each(function() {
            $(this).mouseover(
                    function() {
                        resetClass($(this).attr('id'));
                    }
            );
        });

    });
    function resetClass(v) {
        for (var i = 1; i <= 5; i++) {
            if (i <= v) {
                $('#' + i).removeClass('a').addClass('b');
            }
            else {
                $('#' + i).removeClass('b').addClass('a');
            }
        }
        $('#fenshu').val(v);
    }
    var Alert = ymPrompt.alert;
    var Confirm = ymPrompt.confirmInfo;
    var Success = ymPrompt.succeedInfo;
    var Error = ymPrompt.errorInfo;
    var Win = ymPrompt.win;
    function postdata(obj) {
        var text='';
        if($('#areaval').val()==''){
            text+='请输入城市<br />';
        }
        if($('#hospital').val()==''){
            text+='请输入医院<br />';
        }
        if($('#keshi_id').val()==''){
            text+='请输入医院科室<br />';
        }
        if($('#doctor_id').val()==''){
            text+='请输入医生<br />';
        }
        if($('#con_id').val()==''){
            text+='请输入评论内容<br />';
        }
        if(text!=''){
            Alert(text);
            return false;
        }
        $.post("/apps/doctor/index.php?s=/Index/add", $(obj).serialize(), function (result) { if(result==1){Alert('添加成功');window.parent.location.href=window.parent.location;}; }, "text");
        return false;
    }
</script>